/* ======================================== INCLUDES ======================================== */
#include "bsp_bluetooth.h"

#include "bsp_leds.h"

/* ======================================== MACROS ========================================== */
/* ======================================== TYPES =========================================== */
/* ======================================== GLOBAL VARIABLES ================================ */
extern UART_HandleTypeDef huart1;
/* ======================================== LOCAL VARIABLES ================================= */
uint8_t rx_buf[10];
/* ======================================== PROTOTYPES ====================================== */
/* ======================================== INTERNAL IMPLEMENTATION ========================= */
/* ======================================== EXTERNAL IMPLEMENTATION ========================= */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    if (huart->Instance == USART1)
    {
        if (rx_buf[0] == '1')	
        {
            light_mode_select(LIGHT_MODE_CLASSIC_MARQUEE);
            printf("Start-LIGHT_MODE_CLASSIC_MARQUEE\r\n");
        }
          else if (rx_buf[0] == '2')
        {
            light_mode_select(LIGHT_MODE_ONE_MARQUEE);
            printf("Start-LIGHT_MODE_ONE_MARQUEE\r\n");
        }
        else if (rx_buf[0] == '3')
        {
            light_mode_select(LIGHT_MODE_TWU_MARQUEE);
            printf("Start-LIGHT_MODE_TWU_MARQUEE\r\n");
        }
        else if (rx_buf[0] == '4')
        {
            light_mode_select(LIGHT_MODE_MUSIC);
            printf("Start-LIGHT_MODE_MUSIC\r\n");
        }
        HAL_UART_Receive_IT(&huart1, rx_buf, 1);
    }
    
}


void HC_Init(void)
{
    HAL_UART_Receive_IT(&huart1, rx_buf, 1);
}
